package com.bjwl.web.contrlller.admin;

import com.bjwl.pojo.IpRights;
import com.bjwl.pojo.dto.IpRightDto;
import com.bjwl.service.IpRightsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @Author: dzx
 * @Date:Create：in 2020/5/25 14:17
 * @Description:
 * @Modified By：
 * @Version: 1.0
 */
@Controller
@RequestMapping("/ipr")
public class IpRightsController {

    @Autowired
    private IpRightsService ipRightsService;

    @GetMapping("/findAll")
    private String findAll(Model model){
        List<IpRightDto> list = ipRightsService.findAll();
        model.addAttribute("list",list);
        return "main_oa/ipRights-list";
    }

    @GetMapping("/update")
    public @ResponseBody
    boolean update(IpRights ipRights){
        ipRightsService.update(ipRights);
        return true;
    }
}
